﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace soma
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            config.Routes.MapHttpRoute(
                name: "WebsitesApi",
                routeTemplate: "api/websites/{controller}/{action}/{id}",
                defaults: new { action = RouteParameter.Optional,  id = RouteParameter.Optional }
            );

            config.Routes.MapHttpRoute(
                name: "ResourcesApi",
                routeTemplate: "api/resources/{controller}/{tag}",
                defaults: new { tag = RouteParameter.Optional }
            );
            
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}",
                defaults: new { }
            );

            config.Routes.MapHttpRoute(
                name: "DefaultApi2",
                routeTemplate: "api/{controller}/{action}",
                defaults: new { }
            );
        }
    }
}
